package com.itsoku.chat07;

import java.util.concurrent.TimeUnit;
public class TerminatedState {
    public static void main(String[] args) throws InterruptedException {
        Thread thread1 = new Thread("thread1") {
            @Override
            public void run() {
                System.out.println(Thread.currentThread());
            }
        };
        thread1.start();
        //休眠1秒，等待thread1执行完毕
        TimeUnit.SECONDS.sleep(1);
        System.out.println("thread1 state:" + thread1.getState());
    }
}